package com.example.test.泛型;

public class GenericClass<T> {
    private T t;

    public T getT() {
        return t;
    }

    public void setT(T t) {
        this.t = t;
    }

    public static void main(String[] args) {
        GenericClass<String> a=new GenericClass<>();
        a.setT("hello");
        System.out.println(a.getT());

        GenericClass<Integer> b=new GenericClass<>();
        b.setT(123);
        System.out.println(b.getT());
    }
}
